<template>
    <h3>componentA</h3>
    <p>{{ message }}</p>
    <componentB title="父传子：标题" :onEvent="dataFn"/>
</template>

<script>
import componentB from "./componentB.vue";
export default {
    data() {
        return {
            message:""
        }
    },
    components: {
        componentB
    },
    methods: {
        dataFn(data){
            this.message = data;
        }
    },
};
</script>